import json
import requests
url = "http://localhost:9896/EventExtract/assemble/getAssembleResult?nm=123&pageSize=2000&startDate=2022-05-25&endDate=2022-05-25"


def get_data(url: str):
    text = json.loads(requests.get(url).text)
    data = text["data"]["data"]
    events = []
    for d in data:
        events += d['event']
    return events


with open("data_5_25.json", "w", encoding="utf-8") as f:
    json.dump(get_data(url)[:600], f, ensure_ascii=False, indent=4)
